#!/bin/sh
#SBATCH -p G1Part_sce
#SBATCH -N 1
#SBATCH -n 56
#SBATCH --exclusive

source /es01/paratera/parasoft/module.sh  
module load mpi/intel/17
unset I_MPI_PMI_LIBRARY
export I_MPI_JOB_RESPECT_PROCESS_PLACEMENT=0

# create log
if [ ! -d "./log" ];then
mkdir log
fi

# create sol
if [ ! -d "./sol" ];then
mkdir sol
fi

mydate=$(date +%Y-%m-%d)

cd ./log
# create mydate
if [ ! -d "./$mydate" ];then
mkdir $mydate
fi
cd ..

cd ./sol
# create mydate
if [ ! -d "./$mydate" ];then
mkdir $mydate
fi
cd ..



dataroot=/es01/paratera/sce0588

pb=suboff

part=u

nt=1
export OMP_NUM_THREADS=$nt
export OMP_STACKSIZE=500m

np=32
#多进程

for sid
    in 33     
    do
        mpirun -np $np ../solver_big \
            $dataroot/$pb/suboff_matrix_$part\_101_zlj.dat \
            $dataroot/$pb/suboff_vector_rhs_$part\_101_zlj.dat \
            $dataroot/$pb/suboff_vector_init_$part\_101_zlj.dat \
            1e-11 1 -sid $sid -maxiter 100  \
            2>&1 |tee ./log/$mydate/$np\np-$sid-$pb-$part.log
        mv x.txt ./sol/$mydate/sol-$np\np-$sid-$pb-$part.txt
    done